Add Skills API support with container parameter and bash code execution content types#6
Merged
Conversation
…ontent types Co-authored-by: PederHP <127606677+PederHP@users.noreply.github.com>
Co-authored-by: PederHP <127606677+PederHP@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add skills support to response generation
Add Skills API support with container parameter and bash code execution content types
Oct 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive support for the Anthropic Skills API, enabling Claude to use built-in tools like PowerPoint, Excel, Word, and PDF generation through code execution in containerized environments.
What's New
Container and Skills Support
The SDK now supports the
containerparameter in message requests, allowing you to specify skills that Claude can use:Container Reuse
Containers can be reused across multiple requests to maintain state:
Bash Code Execution Content Types
Added four new content types to handle skill execution results:
These types properly deserialize responses from the API and provide strongly-typed access to execution results.
Implementation Details
New Classes
Container- Request parameter with Skills array and optional Id for reuseSkill- Defines individual skills with type ("anthropic" or "custom"), skill_id, and versionContainerResponse- Response property containing the container IDUpdated Classes
MessageParameters- AddedContainerpropertyMessageResponse- AddedContainerpropertyContentTypeenum - Added 4 new bash code execution typesContentConverter- Extended to deserialize new content typesBuilt-in Skills
The following Anthropic skills are available:
Custom skills are also supported by specifying
Type = "custom".Testing
Added comprehensive test suite with 8 unit tests covering:
All tests pass successfully.
Documentation
Added detailed Skills section to README.md with:
Beta Headers Required
Skills functionality requires the following beta headers:
code-execution-2025-08-25- Enables code execution (required for Skills)skills-2025-10-02- Enables Skills APIfiles-api-2025-04-14- For uploading/downloading files to/from containersNote: File API support for downloading skill-generated files will be added in a subsequent PR.
Original prompt
Add skills support to response generation.
Prerequisites
To use Skills, you need:
Implementation Notes
Skills are specified using the container parameter in the Messages API. You can include up to 8 Skills per request.
The structure is identical for both Anthropic and custom Skills—specify the required type and skill_id, and optionally include version to pin to a specific version:
Here's an example of a raw request passing skills:
These are the built-in
anthropicskills:For type
customskills theskill_idis a string (gotten elsewhere).Response content blocks can now have type
bash_code_execution_tool_result. Here are the relevant new types in TypeScript for reference:Example type script code to get files from a skill use result:
We'll add the file endpoint support in a subsequent change. But for context this is how it looks in typescript:
Containers and Container Ids
Responses can now have a container id. These can be used to reuse containers across request as per this example (in t...
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.